<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/includeTop.jsp" %>
<table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="1">
    <tr class="rowHead">
        <td height="20" nowrap align="center" class="globalTextBold">执行人</td>
        <td height="20" nowrap align="center" class="globalTextBold">任务名称</td>
        <td height="20" nowrap align="center" class="globalTextBold">任务日期</td>
        <td height="20" nowrap align="center" class="globalTextBold">计划时间</td>
        <c:if test="${jobStatus=='' || jobStatus=='FINISHED' || jobStatus==null}">
            <td height="20" nowrap align="center" class="globalTextBold">执行时间</td>
        </c:if>
        <td height="20" nowrap align="center" class="globalTextBold">项目名称</td>
        <td height="20" nowrap align="center" class="globalTextBold">项目类型</td>
        <td height="20" nowrap align="center" class="globalTextBold">终端名称</td>
        <td height="20" nowrap align="center" class="globalTextBold">任务状态</td>
        <c:if test="${jobStatus=='' || jobStatus=='FINISHED' || jobStatus=='DELAYED' || jobStatus==null}">
            <td height="20" nowrap align="center" class="globalTextBold">操作</td>
        </c:if>
    </tr>

    <c:forEach var="planJobResult" items="${page.data}" varStatus="status">
        <tr class="rowClass">
            <td height="20" class="globalText">${planJobResult.planJob.planProject.plan.userDisplayName}</td>
            <td height="20" class="globalText">${planJobResult.jobName}</td>
            <td height="20" class="globalText"><fmt:formatDate value="${planJobResult.planJob.planProject.plan.planDate}" pattern="yyyy-MM-dd"/></td>
            <td height="20" class="globalText"><fmt:formatDate value="${planJobResult.planJob.startTime}" pattern="HH:mm"/> ~ <fmt:formatDate value="${planJobResult.planJob.endTime}" pattern="HH:mm"/></td>
            <c:if test="${jobStatus=='' || jobStatus=='FINISHED' || jobStatus==null}">
                <td height="20" class="globalText">
                    <c:if test="${planJobResult.finishedAt!=null && planJobResult.jobStatus=='FINISHED'}">
                        <fmt:formatDate value="${planJobResult.firstUserStepResult.finishedAt}" pattern="HH:mm"/> ~ <fmt:formatDate value="${planJobResult.lastUserStepResult.finishedAt}" pattern="HH:mm"/>
                    </c:if>
                </td>
            </c:if>
            <td height="20" class="globalText">${planJobResult.planJob.planProject.projectName}</td>
            <td height="20" class="globalText">${planJobResult.planJob.planProject.project.category.name}</td>
            <td height="20" class="globalText">${planJobResult.planJob.storeName}</td>
            <td height="20" class="globalText">
                <c:choose>
                    <c:when test="${planJobResult.jobStatus=='FINISHED'}">已完成</c:when>
                    <c:when test="${planJobResult.finishedAt!=null}">延误</c:when>
                    <c:otherwise>未完成</c:otherwise>
                </c:choose>
            </td>
            <c:if test="${planJobResult.finishedAt!=null}">
                <td height="20" class="globalText">
                    <c:if test="${planJobResult.finishedAt!=null}">
                        <input type="button" class="btnStyle" value="查看" onclick="javascript:window.location='<c:url value="/plan/planJobResultDetail.html" />?planJobResultId=${planJobResult.id}';">
                    </c:if>
                </td>
            </c:if>
        </tr>
    </c:forEach>


</table>
<%@ include file="/WEB-INF/jsp/includePagination.jsp" %>
